#pragma once
#include <map>
#include "stdafx.h"

class Datastore
{
public:
	Datastore();
	~Datastore();
	typedef std::shared_ptr<HUSDevice> husObjPtr;
	void AddDevice(const int pszKey, husObjPtr pHusObject)
	{
		m_DeviceObjMap[pszKey] = pHusObject;
	}
	husObjPtr&  GetDevice(const int pszKey)
	{
		return m_DeviceObjMap[pszKey];
	}

	void CreateMore()
	{
		int arry[] = { 1,2,3,4,5 };

		for (auto i : arry)
		{
			husObjPtr ptr(new HUSDevice(i));
			AddDevice(i, ptr);
		}
	}

private:

	synchronizedmap<int, husObjPtr> m_DeviceObjMap;
};
